package com.su.pro;


public class AssociativeMap <K,V> {

	
	private Object objects[][];
	private int mLen;
	private int mIndex =0;
	public AssociativeMap(int len){
		
		objects = new Object[len][2];
		mLen = len;
	}
	
	
	public V get(K k){
		for (int i = 0; i < mLen; i++) {
			if (objects[i][0].equals(k)) {
				return (V)objects[i][1];
			}
		}
		return null;
		
	}
	
	
	
	public void put(K k,V v) {
		if (mIndex>=mLen) {
			throw new ArrayIndexOutOfBoundsException();
		}
		
		objects[mIndex][0] = k;
		objects[mIndex][1] = v;
		mIndex++;
		
	}
	
	public static void main(String [] args) {
		
		AssociativeMap<String, String> map = new AssociativeMap<String, String>(10);
		map.put("hell0", "fuck");
		map.put("hell1", "fuck1");
		map.put("hell2", "fuck2");
		map.put("hell3", "fuck3");
		map.put("hell4", "fuck4");
		map.put("hell6", "fuck5");
		System.out.println(map.get("hell0"));
		
		
		
		
	}
	
	
	
	
	
	
	
	
	

}